CAPILLARY
Overview
The CAPILLARY function calculates the Capillary number (Ca), a dimensionless quantity that characterizes the relative importance of viscous forces to surface tension forces in fluid flow. This number is fundamental in multiphase flow analysis, porous media studies, and film flow calculations.
The Capillary number is defined as:
Ca = \frac{V \mu}{\sigma}
where V is the characteristic velocity (m/s), \mu is the dynamic viscosity (Pa·s), and \sigma is the surface tension (N/m). Physically, it represents the ratio of viscous forces to surface tension forces:
Ca = \frac{\text{Viscous forces}}{\text{Surface forces}}
When Ca << 1, surface tension dominates and interfaces tend to minimize their area, forming spherical droplets or smooth menisci. When Ca >> 1, viscous forces dominate and interfaces can be significantly deformed by flow. The transition region (Ca ~ 1) is particularly important in applications such as enhanced oil recovery, inkjet printing, and microfluidic devices.
This implementation uses the fluids library, a comprehensive Python package for fluid dynamics and engineering calculations. For detailed documentation, see the fluids.core dimensionless numbers documentation. Standard references for this dimensionless group include Perry’s Chemical Engineers’ Handbook and Kundu, Cohen, and Dowling’s Fluid Mechanics (Academic Press, 2012).
This example function is provided as-is without any representation of accuracy.
Excel Usage
=CAPILLARY(V, mu, sigma)
V(float, required): Characteristic velocity in meters per second (m/s)mu(float, required): Dynamic viscosity in Pascal-seconds (Pa·s)sigma(float, required): Surface tension in Newtons per meter (N/m)
Returns (float): The Capillary number (dimensionless). str: An error message if the input is invalid.
Examples
Example 1: Demo case 1
Inputs:
| V | mu | sigma |
|---|---|---|
| 1.2 | 0.01 | 0.1 |
Excel formula:
=CAPILLARY(1.2, 0.01, 0.1)
Expected output:
0.12
Example 2: Demo case 2
Inputs:
| V | mu | sigma |
|---|---|---|
| 0.5 | 0.05 | 0.2 |
Excel formula:
=CAPILLARY(0.5, 0.05, 0.2)
Expected output:
0.125
Example 3: Demo case 3
Inputs:
| V | mu | sigma |
|---|---|---|
| 2 | 0.001 | 0.5 |
Excel formula:
=CAPILLARY(2, 0.001, 0.5)
Expected output:
0.004
Example 4: Demo case 4
Inputs:
| V | mu | sigma |
|---|---|---|
| 0.1 | 0.2 | 0.05 |
Excel formula:
=CAPILLARY(0.1, 0.2, 0.05)
Expected output:
0.4
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.core import Capillary as fluids_capillary
def capillary(V, mu, sigma):
"""
Calculate the Capillary number (Ca) for a fluid system using fluids.core.Capillary.
See: https://fluids.readthedocs.io/fluids.core.html
This example function is provided as-is without any representation of accuracy.
Args:
V (float): Characteristic velocity in meters per second (m/s)
mu (float): Dynamic viscosity in Pascal-seconds (Pa·s)
sigma (float): Surface tension in Newtons per meter (N/m)
Returns:
float: The Capillary number (dimensionless). str: An error message if the input is invalid.
"""
try:
V_ = float(V)
mu_ = float(mu)
sigma_ = float(sigma)
except (TypeError, ValueError):
return "Error: All parameters must be numeric values."
try:
result = fluids_capillary(V_, mu_, sigma_)
except (ValueError, ZeroDivisionError) as e:
return f"Error: Failed to calculate Capillary number: {str(e)}"
except Exception as e:
return f"Error: {str(e)}"
return result